package com.geo.keyword.dto;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 关键词列表响应DTO
 */
public class KeywordListResponse {
    
    /**
     * 关键词列表
     */
    private List<KeywordItem> keywords;
    
    /**
     * 总数量
     */
    private Long totalCount;
    
    /**
     * 当前页码
     */
    private Integer currentPage;
    
    /**
     * 每页大小
     */
    private Integer pageSize;
    
    /**
     * 总页数
     */
    private Integer totalPages;
    
    // 内部类：关键词项
    public static class KeywordItem {
        private String id;
        private String keyword;
        private String category;
        private String priority;
        private String status;
        private String optimizationStatus;
        private Double adoptionRate;
        private Long searchVolume;
        private Double difficulty;
        private LocalDateTime createdAt;
        private LocalDateTime updatedAt;
        private String description;
        private String tags;
        
        // Getters and Setters
        public String getId() { return id; }
        public void setId(String id) { this.id = id; }
        
        public String getKeyword() { return keyword; }
        public void setKeyword(String keyword) { this.keyword = keyword; }
        
        public String getCategory() { return category; }
        public void setCategory(String category) { this.category = category; }
        
        public String getPriority() { return priority; }
        public void setPriority(String priority) { this.priority = priority; }
        
        public String getStatus() { return status; }
        public void setStatus(String status) { this.status = status; }
        
        public String getOptimizationStatus() { return optimizationStatus; }
        public void setOptimizationStatus(String optimizationStatus) { this.optimizationStatus = optimizationStatus; }
        
        public Double getAdoptionRate() { return adoptionRate; }
        public void setAdoptionRate(Double adoptionRate) { this.adoptionRate = adoptionRate; }
        
        public Long getSearchVolume() { return searchVolume; }
        public void setSearchVolume(Long searchVolume) { this.searchVolume = searchVolume; }
        
        public Double getDifficulty() { return difficulty; }
        public void setDifficulty(Double difficulty) { this.difficulty = difficulty; }
        
        public LocalDateTime getCreatedAt() { return createdAt; }
        public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
        
        public LocalDateTime getUpdatedAt() { return updatedAt; }
        public void setUpdatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; }
        
        public String getDescription() { return description; }
        public void setDescription(String description) { this.description = description; }
        
        public String getTags() { return tags; }
        public void setTags(String tags) { this.tags = tags; }
    }
    
    // 构造函数
    public KeywordListResponse() {}
    
    public KeywordListResponse(List<KeywordItem> keywords, Long totalCount, Integer currentPage, Integer pageSize) {
        this.keywords = keywords;
        this.totalCount = totalCount;
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.totalPages = (int) Math.ceil((double) totalCount / pageSize);
    }
    
    // Getters and Setters
    public List<KeywordItem> getKeywords() {
        return keywords;
    }
    
    public void setKeywords(List<KeywordItem> keywords) {
        this.keywords = keywords;
    }
    
    public Long getTotalCount() {
        return totalCount;
    }
    
    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }
    
    public Integer getCurrentPage() {
        return currentPage;
    }
    
    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }
    
    public Integer getPageSize() {
        return pageSize;
    }
    
    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
    
    public Integer getTotalPages() {
        return totalPages;
    }
    
    public void setTotalPages(Integer totalPages) {
        this.totalPages = totalPages;
    }
}